package cn.jiyun.demo_users.impl;

import cn.jiyun.demo_users.mapper.UsersMapper;
import cn.jiyun.demo_users.pojo.Users;
import cn.jiyun.demo_users.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class UsersServiceImpl implements UsersService {
    @Autowired
    private UsersMapper usersMapper;
    @Override
    public void addUsers(Users users) {
        this.usersMapper.insertUsers(users);
    }

    @Override
    public List<Users> listUsers() {
        return usersMapper.listUsers();
    }

    @Override
    public Users login(Users users) {
        return usersMapper.login(users);
    }
}
